{% extends "blog/base.html" %} 
{% load staticfiles %}

<!-- 显示文章内容 -->
{% block content %}
<script type="text/javascript" charset="utf-8" src="{% static 'blog/js/markdownJs.js' %}"></script>
<section class="post">
	<header class="post-header">
		<h2 class="post-title">{{ post.title }}</h2>
		<p class="post-meta">
			作者: <a class="post-author" href="#">{{ post.author|safe}}</a> 
			时间: <a class="post-author" href="#">{{ post.dateTime|date:"Y/m/d"}}</a> 
			分类：<a class="post-category post-category-js" href="#">{{ post.category|safe }}</a>
		</p>
	</header>
<div id="post-preview">
<textarea class="post-article">
{{ post.content}}
</textarea>

</div>
</section>
<img id="h2back" src="{% static 'blog/img/default-bg.gif' %}"  style="display:none;"/>
<div id="show-article" class="show-preview" style="display:none;">
</div>
<script>
postmd();
 </script>
{% endblock content%}

<!-- 显示文章内容 -->

<!-- 评论显示 -->
{% block postComment %}
<div class="panel panel-default">
	<a name="allcomments" data-toggle="collapse"
		data-target="#collapseComments" href="#allcomments">所有评论</a>
	<div id="collapseComments" class="collapse">
		<!-- 评论部分 -->
		{% if not comments %}
		<p>目前没有评论</p>
		{% endif %} {% for comment in comments %}
		<div >
			<p class="comment-name">昵称：{{ comment.nickName }}</p>
			<textarea class="comment-mark" data-height="100">{{ comment.content}}</textarea>

		</div>
		<p class="comment-date">评论时间: {{ comment.dateTime|date:"Y/m/d h:m:s" }}</p>

 <script> commentmd();</script>
 
	{% endfor %}

	</div>
</div>


<!-- 提交评论的表单 -->
<form class="well" action="{% url 'blog:comment' %}" method="post">
	{% csrf_token %} <label for="author" class="span3">昵称 </label>
	<div class="row">
		<input type="text" name="nickname" id="nickname" class="textfield"
			value="" size="24" tabindex="1" placeholder="输入昵称......">
	</div>
	<div class="postid">
		<input name="postid" type="postid" id="postid" class="hidden"
			tabindex="5" value={{post.id}}>
	</div>
	<br /> <label>评论 </label>
	<div class="row">
		<textarea id="target-editor-with-custom-buttons" name="comment" data-provide="markdown" id="comment" tabindex="4" rows="8" cols="50" placeholder="输入评论内容......"></textarea>
	</div>

	<div class="submitbutton">
		<input name="submit" type="submit" id="submit" class="button"
			tabindex="5" value="提交评论">
	</div>
</form>


{% endblock postComment %}
<!-- 提交直接评论的表单 -->


<!-- 侧边列出相关文章 -->
{% block articles %}
<button type="button" class="btn btn-info" data-toggle="collapse"
	data-target="#collapseArticles">全部文章</button>

<div id="collapseArticles" class="collapse">
	{% for post in postList %} <a href="{{ post.get_absolute_url }}">{{post.title}}</a><br />
	{% endfor %}
</div>

{% endblock articles%}
<!-- 侧边列出相关文章 -->




